package com.cgy.utils.jmx.system.hardware;

import oshi.SystemInfo;
import oshi.hardware.*;
import oshi.software.os.FileSystem;
import oshi.software.os.OperatingSystem;

/**
 * @author CHTK
 */
public class Hardware {

    public static SystemInfo SYSTEM_INFO;
    public static HardwareAbstractionLayer SYSTEM_INFO_HARDWARE ;
    public static OperatingSystem OPERATING_SYSTEM;
    public static GlobalMemory GLOBAL_MEMORY;
    public static FileSystem FILE_SYSTEM;
    public static CentralProcessor PROCESSOR;
    public static HWDiskStore[] DISK;
   // public static Sensors SENSOR;
    public static ComputerSystem COMPUTER_SYSTEM;
   // public static Display[] DISPLAYS;
    public static NetworkIF[] NETWORK_IFS;
   // public static UsbDevice[] USB_DEVICES_TRUE;
    //public static UsbDevice[] USB_DEVICES_FALSE;

    public static void refresh() {
         SYSTEM_INFO = new SystemInfo();
         SYSTEM_INFO_HARDWARE = SYSTEM_INFO.getHardware();
         OPERATING_SYSTEM = SYSTEM_INFO.getOperatingSystem();
         GLOBAL_MEMORY = SYSTEM_INFO_HARDWARE.getMemory();
         PROCESSOR = SYSTEM_INFO_HARDWARE.getProcessor();
         DISK = SYSTEM_INFO_HARDWARE.getDiskStores();
         //SENSOR = SYSTEM_INFO_HARDWARE.getSensors();
         COMPUTER_SYSTEM = SYSTEM_INFO_HARDWARE.getComputerSystem();
         //DISPLAYS = SYSTEM_INFO_HARDWARE.getDisplays();
         NETWORK_IFS = SYSTEM_INFO_HARDWARE.getNetworkIFs();
         //USB_DEVICES_TRUE = SYSTEM_INFO_HARDWARE.getUsbDevices(true);
         //USB_DEVICES_FALSE = SYSTEM_INFO_HARDWARE.getUsbDevices(false);
    }

    static {
        refresh();
    }
}
